@extends('admin.admin')

@section('content')
<link rel="stylesheet" href="/components/AdminLTE/plugins/daterangepicker/daterangepicker-bs3.css">
        <!-- Content Header (Page header) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
<script src="/components/AdminLTE//plugins/daterangepicker/daterangepicker.js"></script>
<section class="content-header">
    <h1>
        操作日志
        <small>日志列表</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="/admin"><i class="fa fa-dashboard"></i> 控制面板</a></li>
        <li ><a href="/admin/operationLog">操作日志</a></li>
        <li class="active">日志列表</li>
    </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="row">
        <div class="col-xs-12">



            <div class="box box-primary ">
                <div class="box-body table-responsive">

                    {!! Form::model(@$operationLogs,array('route' => 'admin.operationLog.index','method' => 'get','class'=>'form-search form-inline')) !!}

                        <div class="form-group">
                                {!! Form::text('user_name',@$_GET['user_name'],array('class'=>'form-control ','placeholder'=>'用户'))!!}
                        </div>
                        <div class="form-group">
                                {!! Form::text('operation_type',@$_GET['operation_type'],array('class'=>'form-control ','placeholder'=>'操作内容'))!!}
                        </div>
                        <div class="form-group">
                                {!! Form::text('operation_date',@$_GET['operation_date'],array('class'=>'form-control ','placeholder'=>'操作表'))!!}
                        </div>
                        <div class="form-group">
                                {!! Form::text('operation_id',@$_GET['operation_id'],array('class'=>'form-control ','placeholder'=>'操作对象ID'))!!}
                        </div>

                        <div class="form-group">
                            <div class="input-group">
                                <button type="button" class="btn btn-default pull-right" id="daterange-btn">
                                    <i class="fa fa-calendar"></i> <span class="show-span">时间</span>
                                    <i class="fa fa-caret-down"></i>
                                </button>
                                {!! Form::hidden('time',@$_GET['time'],array('class'=>'form-control','placeholder'=>'时间','id'=>'time'))!!}

                            </div>
                        </div>

                        {{--<div class="form-group">--}}
                            {{--{!! Form::text('user_name',$search['user_name'],['class'=>'form-control','placeholder'=>'用户名'])!!}--}}
                        {{--</div>--}}

                        <button type="submit" class="btn btn-primary">搜索</button>
                        <button type="button" onclick="window.location.href='/admin/operationLog'" class="btn btn-default">重置</button>
                    {!! Form::close() !!}
                </div>

            </div><!-- end .box box-primary -->

            <div class="box box-primary">
                <div class="box-header">
                    <h3 class="box-title">日志列表</h3>
                </div>
                <!-- /.box-header -->
                <div class="box-body table-responsive no-padding">
                    <table class="table table-hover">
                        <tr>
                            <th class="text-center" style="width: 60px">管理员</th>
                            <th>操作内容</th>
                            <th>操作表</th>
                            <th>操作对象ID</th>
                            <th>操作时间</th>
                        </tr>
                        @foreach($operationLogs as  $item)
                            <tr>
                                <td>{{$item->user}}</td>
                                <td>{{$item->operation_type}}</td>
                                <td>{{$item->operation_date}}</td>
                                <td>{{$item->operation_id}}</td>
                                <td>{{$item->time}}</td>
                            </tr>
                        @endforeach


                    </table>

                </div>
                <!-- /.box-body -->
                <div class="pagination ">
                    {!!$operationLogs->appends($filter)->render()!!}
                </div>

            </div>

            <!-- /.box -->

        </div>
    </div>


</section>
<!-- /.content -->

<script>
    var daterRange=$('#daterange-btn'),input=$('#time'),getTime=input.val();

    utils.datePredefinedRanges(daterRange,input,getTime);
</script>


@endsection